package org.lql.chaos.core.exception.customize;

import lombok.Getter;

/**
 * @author: liangqinglong
 * @date: 2025-07-14 15:25
 * @description:
 **/
@Getter
public class CustomizeError extends Error {

	private final IErrorCode errorCode;

	public CustomizeError(String message, IErrorCode errorCode) {
		super(message);
		this.errorCode = errorCode;
	}

	public CustomizeError(String message, Throwable cause, IErrorCode errorCode) {
		super(message, cause);
		this.errorCode = errorCode;
	}

	public CustomizeError(Throwable cause, IErrorCode errorCode) {
		super(cause);
		this.errorCode = errorCode;
	}

	public CustomizeError(IErrorCode errorCode) {
		super();
		this.errorCode = errorCode;
	}

	@Override
	public String toString() {
		return "CustomizeError {" +
				"code=" + errorCode.getCode() +
				", message='" + errorCode.getMessage() + '\'' +
				'}';
	}
}
